public class Demo
{
    //字段 feild
    private int id;
    private string name;
    private int age;
    
    //属性 property
    public int Id
    {
        get => id;
        set => id = value;
    }

    public string Name
    {
        get => name;
        set => name = value ?? throw new ArgumentNullException(nameof(value));
    }

    public int Age
    {
        get => age;
        set => age = value;
    }
    
    public void TestPrint()
    {
        Parent parent = new Parent();
        parent.Print();
        Child child = new Child();
        //child.Print();//子类没有定义此方法时，子类继承父类的方法
        child.Print();//子类重写该方法时，用子类的方法
        child.Play();
        Console.WriteLine("--------");
        Parent p1 = new Child();
        p1.Print();
        
        // int result = Add(10,20);//实参
        // Console.WriteLine(result);
        
    }

    //方法的重载 overload
    public int Add(int a ,int b)
    {
        return a + b;
    }

    public string Add(string a, string b)
    {
        return a + b;
    }
}